/**
 * FileName: JsonUtil
 * Author:   powersi
 * Date:     2021/2/26 10:29
 * Description:
 */
package com.zm.demo.netty.action.util;

import com.google.gson.Gson;

/**
 * Description: 
 * Author:      powersi
 * Date:        2021/2/26 10:29
 */
public class JsonUtil {

    private static final Gson GSON = new Gson();

    private JsonUtil(){}

    public static <T> T fromJson(String jsonStr, Class<T> clazz){
        return GSON.fromJson(jsonStr, clazz);
    }

    public static String toJson(Object o){
        return GSON.toJson(o);
    }
}
